Skip to content

fix: allow underscores in git PackageDownloadLocation validation#886

Open
Xavrir wants to merge 1 commit intospdx:mainfrom
Xavrir:fix/allow-underscore-in-git-download-location
Open

fix: allow underscores in git PackageDownloadLocation validation#886
Xavrir wants to merge 1 commit intospdx:mainfrom
Xavrir:fix/allow-underscore-in-git-download-location

Conversation

@Xavrir
Copy link

@Xavrir Xavrir commented Mar 18, 2026

Summary

  • allow underscores in the repository path segment of git+git@ download locations
  • the git_pattern regex in uri_validators.py was missing _ in its allowed character class, causing valid URLs like git+git@github.com:zephyrproject-rtos/CMSIS_6@... to fail validation
  • consistent with the identical fix applied in the Java counterpart (spdx-java-model-2_X#33)

Testing

  • added a regression test using the exact example from the issue
  • pytest -vvs passes all 69 URI validator tests
  • isort, black, flake8 all clean

Closes #860

The git_pattern regex rejected repository names containing underscores,
such as CMSIS_6. This adds underscore to the allowed character class in
the path segment of git+git@ download locations.

Closes spdx#860

Signed-off-by: Rizky Mirzaviandy Priambodo <142987522+Xavrir@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PackageDownloadLocation validation doesn't allow underscores in git URLs

1 participant